package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MemberPointsRuleMapper;
import com.ruoyi.system.domain.MemberPointsRule;
import com.ruoyi.system.service.IMemberPointsRuleService;

/**
 * 会员积分规则（存储各门店的积分获取与抵现规则）Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-14
 */
@Service
public class MemberPointsRuleServiceImpl implements IMemberPointsRuleService
{
    @Autowired
    private MemberPointsRuleMapper memberPointsRuleMapper;

    /**
     * 通过id查询会员积分规则
     *
     * @param id 会员积分规则（存储各门店的积分获取与抵现规则）主键
     * @return 会员积分规则（存储各门店的积分获取与抵现规则）
     */
    @Override
    public MemberPointsRule selectMemberPointsRuleById(Long id)
    {
        return memberPointsRuleMapper.selectMemberPointsRuleById(id);
    }

    /**
     * 查询会员积分规则列表
     *
     * @param storeName 门店名称
     * @return 会员积分规则（存储各门店的积分获取与抵现规则）
     */
    @Override
    public List<MemberPointsRule> selectMemberPointsRuleListByName(String storeName)
    {
        return memberPointsRuleMapper.selectMemberPointsRuleListByName(storeName);
    }

    /**
     * 新增会员积分规则列表
     *
     * @param memberPointsRule 会员积分规则（存储各门店的积分获取与抵现规则）
     * @return 结果
     */
    @Override
    public int insertMemberPointsRule(MemberPointsRule memberPointsRule)
    {
        return memberPointsRuleMapper.insertMemberPointsRule(memberPointsRule);
    }

    /**
     * 修改会员积分规则列表
     *
     * @param memberPointsRule 会员积分规则（存储各门店的积分获取与抵现规则）
     * @return 结果
     */
    @Override
    public int updateMemberPointsRule(MemberPointsRule memberPointsRule)
    {
        return memberPointsRuleMapper.updateMemberPointsRule(memberPointsRule);
    }

    /**
     * 批量删除会员积分规则列表
     *
     * @param ids 需要删除的会员积分规则（存储各门店的积分获取与抵现规则）主键
     * @return 结果
     */
    @Override
    public int deleteMemberPointsRuleByIds(Long[] ids)
    {
        return memberPointsRuleMapper.deleteMemberPointsRuleByIds(ids);
    }

    /**
     * 删除会员积分规则信息列表
     *
     * @param id 会员积分规则（存储各门店的积分获取与抵现规则）主键
     * @return 结果
     */
    @Override
    public int deleteMemberPointsRuleById(Long id)
    {
        return memberPointsRuleMapper.deleteMemberPointsRuleById(id);
    }
}
